const fs = require("fs");
const path = require("path");
fs.readFile(path.resolve(__dirname, "./test.txt"), function (err, data) {
  if (err) {
    console.log("readfile error!");
  } else {
    console.log("success", data.toString("utf-8"));
    console.log(data.length + "bytes");
    let buf = Buffer.from(data.toString("utf-8"), "utf-8");
    console.log(buf);
  }
});
